package com.test

import com.Crc32
import com.entity.PackPath
import kotlin.test.Test

class CrcTest {

    @OptIn(ExperimentalStdlibApi::class)
    @Test
    fun dccCodeTest() {
        println(-0x112234)
        println((0xffeeddcc).toInt())
        println(0xffeeddcc)

        val hex = Integer.toHexString(137504116)
        println(hex)
        println(hex.toUInt(16))
        println(hex.toInt(16))

        println(Int.MAX_VALUE)
        println("bee5cb47".toUInt(16))
        println("bee5cb47".toUInt(16).toInt())
        println(Integer.toHexString("bee5cb47".toUInt(16).toInt()))
        println("bee5cb47".toUInt(16).toInt().toHexString())
        println((-1092236473).toUInt())
// 3202730823



    }

    @OptIn(ExperimentalStdlibApi::class)
    @Test
    fun fileCrcTest() {

        val v = Crc32.crc32(PackPath("E:/Project/packTest/old/aes.js"))

        println("b2369e35".toUInt(16))
        println(v)

        println(v.toHexString(HexFormat { number {
            removeLeadingZeros = true
        } }))
        println(Integer.toHexString(v.toInt()))



    }

    @Test
    fun verifyTest() {

        val path = "D:/WorkSpace/Idea/Java/PackProject/cache/main-e787563d.js"

        val packPath = PackPath(path)


        println(
            packPath.crc()
        )


    }


}